package com.ms.str.param;

/**
 * 先执行父类静态代码块
 * 再执行子类的静态代码块
 *
 * 父类的无参数构造方法
 * 子类的构造方法
 *
 * @author carter
 * create time    2018-08-14
 */
public class TestOrder {

    public static void main(String[] args) {

        new Child();//输出啥？

    }

}

class Parent{

    static String name = "hello";
    static {

        System.out.println("parent static block ");
    }

    public Parent(){

        System.out.println("parent construct ");
    }


}


class Child extends Parent{

    static String childName = "world";
    static {
        System.out.println("child static block");
    }

    public Child()
    {
        System.out.println("child construct");
    }


}

